if (index(W $PP.SET) >= 0) {//^notice $0 [PurePak] You have been added to my friends list for channels matching [${AA}]: type /ctcp $N HELP for functions available to you}
echo *** Warning: your client's ischanop() function is inaccurate \($1 is op, ischanop() reports not op\)\; channel op status on /users lists may be wrong
@ PP.ICWARNED = 1
}
}
{
if ((ischanop($1 $0))&&(!PP.ICWARNED))
{
echo *** Warning: your client's ischanop() function is inaccurate \($1 is not op, ischanop() reports op\)\; channel op status on /users lists may be wrong
if ([$1] == [KICK]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] Kicked from $4 by $3 [$strip(~ $2)] \($5-\)}
if ([$1] == [BAN]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] $3 [$strip(~ $2)] banned you from $4 with bans: $5-}
if ([$1] == [FLOOD]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] $4- from $3 [$strip(~ $2)] detected}
if ([$1] == [DEOP]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] $3 [$strip(~ $2)] deopped you on $4}
if ([$1] == [OP]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] $3 [$strip(~ $2)] opped you on $4}
if ([$1] == [DCC]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] DCC $4 \($5\) received from $2 [$strip(~ $3)]}
}
alias playback {
if (AWAYLOG[0])
{
if (PBFILE)
{
@ PBFILE_OLD = PBFILE
^assign -PBFILE
}
@ CTR = 0
^pp.pauseset
while (CTR <= PP.AWAYLCTR)
{
^pp.playback $AWAYLOG[$CTR]
@ CTR = CTR + 1
}
^pp.pauseend
^assign -CTR
if (PBFILE_OLD)
{
@ PBFILE = PBFILE_OLD
^assign -PBFILE_OLD
}
} {/echo *** No messages or events to play back}
}
alias clearlog {
foreach AWAYLOG AA {^assign -AWAYLOG[$AA]}
@ PP.AWAYLCTR = 0
echo *** Away log is now empty
}
alias away {
if (!(A))
{
if ([$0]) {//away $*}
{
if (index(G $PP.SET) >= 0) {//away All messages will be logged...} {//away Gone...}
}
wait -CMD if (1) {
if ((!!(C))&&(index(O $PP.SET) >= 0))
{
^assign SEND_MSG ACTION is away: ${A}
^pp.listmsg PRIVMSG $mychannels()
^assign -SEND_MSG
echo * $N is away: $A
}
}
if (index(H $PP.SET) >= 0)
{
^assign PBFILE $PP.SET.ALFILE
^exec -name pbfile $PP.SET.CATCMD >>$PBFILE
echo *** Away log file ${PBFILE} opened
}
@ PP.AWAYSINCE = Z
}
{
//away
wait -CMD if (1) {
^assign -PP.AWAYSINCE
if (index(G $PP.SET) >= 0) {/echo *** Type /playback to play back away log, type /clearlog to clear away log.}
if ((!!(C))&&(index(O $PP.SET) >= 0))
{
^assign SEND_MSG ACTION is back.
^pp.listmsg PRIVMSG $mychannels()
^assign -SEND_MSG
echo * $N is back.
}
}
if (index(H $PP.SET) >= 0)
{
^exec -close %pbfile
echo *** Away log file ${PBFILE} closed
^assign -PBFILE
}
}
}
# paway <nick> <msg/->
alias paway {
if ([$0])
{
if ([$1])
{
if ([$1] == [-])
{
^assign -PP.PAWAYS[$encode($toupper($0))]
echo *** Personal away message for $0 removed
}
{
@ PP.PAWAYS[$encode($toupper($0))] = [$1-]
echo *** Personal away message for $0 added: $1-
}
}
{
if (PP.PAWAYS[$encode($toupper($0))]) {/echo *** Personal away message for $0: $PP.PAWAYS[$encode($toupper($0))]}
{/echo *** No personal away message set for $0}
}
}
{
echo *** Nick Message
foreach PP.PAWAYS AA {/echo *** $[10]decode($AA) $PP.PAWAYS[$AA]}
}
}
alias write {/comment $write($*)}
alias sve {
if (!(HOME))
{
exec -name rm $PP.SET.RMCMD $PP.SAVEFILE
echo *** Warning: Your home directory could not be determined. Your saved settings file will be saved to the current working directory. If this isn't your home directory, PurePak may not be able to find it's saved settings file at startup!
foreach PP.FRIENDS AA {$WM @ PP.FRIENDS[$AA] = [$PP.FRIENDS[$AA]]}
foreach PP.ENEMIES AA {$WM @ PP.ENEMIES[$AA] = [$PP.ENEMIES[$AA]]}
$WM ^pp.savedfrom $strip(.ba $PPVERS)
$WM echo *** Saved settings loaded from ${PP.SAVEFILE}
if (match(*xecho* $WM))
{
^window log off
^window kill
}
{
comment $close($FHANDLE)
^assign -FHANDLE
}
^assign -WM
echo *** Current settings saved to ${PP.SAVEFILE}
}
}
alias pp.savedfrom {
if ([$0] < 109)
{
^alias echo {}
foreach FRIENDS AA {
^pp.addl FRIENDS $FRIENDS[$AA] *
^assign -FRIENDS[$AA]
}
foreach ENEMIES AA {
^pp.addl ENEMIES $ENEMIES[$AA] *
^assign -ENEMIES[$AA]
}
^alias -echo
^timer 30 /echo *** Your old friends/enemies lists from your previous version of PurePak have been added to the 'global' friends/enemies lists in this version. You should /sve now to save the lists in the new format. (Type /lsfriends and /lsenemies to check your lists)
^timer 30 /echo *** There have been changes to the saved file format. Auto-converted, but you should /sve now so you don't see this message again.
}
}
^timer 5 ^alias -pp.savedfrom
}
# So the "IRC log started ..." comments in the logfile do nothing
alias IRC {}
alias pphelp {
if ([$0]) {
if (!(PPHELP.HELP))
{
^set input_prompt Loading help database...
//^load purepak.hlp
^set -input_prompt
if (!(PPHELP.HELP)) {/echo *** Error loading purepak.hlp: check to make sure that the file exists and is in a directory where it can be found.} {/pphelp $*}
}
{
@ PP.HELPLASTUSED = time()
if ([$1]) {@ EN = [$0_$1]} {@ EN = [$0]}
if (!(PPHELP[$EN][0])) {/echo *** No help available on '$*'}
{
^pp.pauseset
echo *** Help: $*
foreach PPHELP.$EN AA {/echo -- $PPHELP[$EN][$AA]}
echo --
^pp.pauseend
}
^assign -EN
}
} {/pphelp HELP}
}
alias lockmode {
if ([$0])
{
if (!ischannel($0)) {/echo *** /lockmode <#channel> <mode(s) to lock/off>}
{
if ([$1])
{
if ([$1] == [OFF])
{
if (!(LOCKEDMODES[$encode($0)])) {/echo *** No modes are locked on $0}
{
^assign -LOCKEDMODES[$encode($0)]
if (gotops($0))
{
if (index(W $PP.SET) >= 0)
{
if ([$0] == C) {/me : Mode no longer locked} {/describe $0 : Mode no longer locked}
}
}
echo *** Mode on channel $0 no longer locked
}
}
{
if (rmatch($1 *-* *o* *v*)) {/echo *** Cannot lock that mode. /pphelp lockmode for help.}
{
^assign LOCKEDMODES[$encode($0)] $1-
if (gotops($0))
{
if (index(W $PP.SET) >= 0)
{
if ([$0] == C) {/me : Mode locked to: $1-} {/describe $0 : Mode locked to: $1-}
# Speed improved by Tris, Speed improved still more by CKeeper
alias pp.formecho {
@ AA = 0
@ AB = decode($0)
@ AC = mid(0 1 $AB)
while (AC)
{
if (!strip(NUMT $AC))
{
if (AC == [N]) {@ AD = AD##[$1]}
{if (AC == [U]) {@ AD = AD##[$2]}
{if (AC == [M]) {@ AD = AD##[$3-]}
{if (AC == [T]) {@ AD = AD##[<$word(3 $stime($time()))>]}}}}
} {@ AD = AD##AC}
@ AA = AA + 1
@ AC = mid($AA 1 $AB)
}
echo $AD
^assign -AC
^assign -AD
}
# Make some notices look better and be more informative
on ^482 * {^if ([$0] != S) {/echo *** You are desynched on $1 \(from server $0\)} {/echo *** You are not channel operator on $1}}
on ^442 * {^if ([$0] != S) {^if (match($1 $mychannels())) {/echo *** You are desynched: server $0 doesn't think you are on channel $1} {/echo *** You are not on channel $1 \(from server $0\)}} {/echo *** You are not on channel $1}}
on ^465 * {/echo *** You are banned (K-lined) from server $0}
on ^333 * {^if (!match(*.* $2)) {/echo *** Topic was set on $1 by $2 at $stime($3)}}
on ^375 * {^if ((suppress_server_motd != [ON])||(PP.SEENMOTD)) {/echo ++ $1-}}
on ^372 * {^if ((suppress_server_motd != [ON])||(PP.SEENMOTD)) {/echo -- $1-}}
on ^376 * {@ PP.SEENMOTD = 1}
EVAL ^if (PP.EPIC) {
on ^323 * {}
on ^376 * {}
on ^219 * {}
}
on ^leave * {/xecho -level CRAP *** $0 has left channel $1}
echo *** Warning: your client's ischanop() function is inaccurate \($7 is op, ischanop() reports not op\)\; channel op status on /users lists may be wrong
@ PP.ICWARNED = 1
}
}
{
if ((ischanop($7 $3))&&(!PP.ICWARNED))
{
echo *** Warning: your client's ischanop() function is inaccurate \($7 is not op, ischanop() reports op\)\; channel op status on /users lists may be wrong
@ PP.ICWARNED = 1~
}
}
}
foreach PP.USERS.$WINNUM().$encode($tolower($0)) AA {^assign -PP.USERS[$WINNUM()][$encode($tolower($0))][$AA]}
//^who $0
} {@ SYNCNEXT[$rand(9999)] = [$0]}
}
on ^315 * {
if (SYNCING)
{
^on raw_irc - "% 352 *"
@ DONE1 = 0
@ PP.USYNCED[$SYNCING] = 1
^assign -SYNCING
foreach SYNCNEXT AA {
if (!DONE1)
{
^timer 1 ^pp.syncchan $SYNCNEXT[$AA]
^assign -SYNCNEXT[$AA]
@ DONE1 = 1
}
}
^assign -DONE1
}
}
on #-raw_irc 10 "% JOIN %#*" {
if (match(:* $2)) {@ AA = mid(1 1000 $2)} {@ AA = [$2]}